#
#/home/zhaigy/local/libevent/

VPATH=src:libsphinxclient:json:log

EVENT_H=/home/zhaigy/local/libevent/include
EVENT_LIB=/home/zhaigy/local/libevent/lib

CC=g++

sphinx_http_proxy_c:main.o config.o log.o json.o sphinxclient.o
	$(CC) -o sphinx_http_proxy_c -levent -L$(EVENT_LIB) -ggdb \
		src/main.o  src/config.o \
		log/log.o json/json.o libsphinxclient/sphinxclient.o

main.o:src/main.c
	$(CC) -c -o src/main.o -I$(EVENT_H) src/main.c

config.o:src/Config.cpp
	$(CC) -c -o src/config.o src/Config.cpp

log.o:log/log.cpp
	$(CC) -c -o log/log.o log/log.cpp

json.o:json/jsoncpp.cpp
	$(CC) -c -o json/json.o json/jsoncpp.cpp

sphinxclient.o:libsphinxclient/sphinxclient.c
	gcc -c -o libsphinxclient/sphinxclient.o libsphinxclient/sphinxclient.c

clean:
	rm -rf sphinx_http_proxy_c
	rm -rf src/*.o
	rm -rf log/*.o
	rm -rf json/*.o
	rm -rf libsphinxclient/*.o

